import 'package:flutter/material.dart';
import 'package:yp/router.dart';
import 'package:yp/widgets/select_button.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

import 'package:get/get.dart';

import 'logic.dart';
import 'state.dart';

class ApplySuccessPage extends StatelessWidget {
  final ApplySuccessLogic logic = Get.put(ApplySuccessLogic());
  final ApplySuccessState state = Get.find<ApplySuccessLogic>().state;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.white,
        iconTheme: IconThemeData(color: Colors.black),
        title: Text(
          '售后详情',
          style: TextStyle(
            color: Colors.black,
            fontSize: 32.sp,
          ),
        ),
        centerTitle: true,
        elevation: 0,
      ),
      body: GetBuilder<ApplySuccessLogic>(
        builder: (logic) {
          return SingleChildScrollView(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                SizedBox(
                  height: 20.w,
                ),
                Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    Image(
                      image: AssetImage("assets/images/selectIcon1.png"),
                      width: 40.w,
                    ),
                    SizedBox(
                      width: 10.w,
                    ),
                    Text(
                     '申请成功',
                      style: TextStyle(
                        color: Color(0xff222222),
                        fontSize: 36.sp,
                      ),
                    )
                  ],
                ),
                SizedBox(
                  height: 20.w,
                ),
                Text(
                  '我们将尽快处理您的申请',
                  style: TextStyle(
                    color: Color(0xff666666),
                    fontSize: 26.sp,
                  ),
                ),
                SizedBox(
                  height: 40.w,
                ),
                Row(
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: [
                    SelectButton(
                      title: "返回首页",
                      isSelected:false,
                      onTap: () {
                        Get.offAllNamed(RouteConfig.main);
                      },
                    ),
                    SizedBox(width: 20.w),
                    SelectButton(
                      title: "查看详情",
                      isSelected: true,
                      onTap: () {
                        Get.toNamed(RouteConfig.applyDetail,arguments: {
                          'id':state.id
                        });
                      },
                    ),
                  ],
                )
              ],
            ),
          );
        },
      ),
    );
  }

}
